/**
 * Created with File
 * Author: Chuans
 * Github: https://github.com/chuans
 * Date: 2018/9/7
 * Time: 下午5:00
 */

import {Input} from 'antd';
import {NotiType, NotiTarget} from '../../enum/notification';

export const searchForm: any[] = [{
    key: 'nick_name',
    Component: Input,
    label: '昵称',
    props: {
        placeholder: '请输入昵称查询'
    }
}, {
    key: 'phone',
    Component: Input,
    label: '电话号码',
    props: {
        placeholder: '请输入电话号码查询'
    }
}, {
    key: 'type',
    Component: 'Select',
    initialValue: '',
    selectList: [{
        value: '',
        name: '全部'
    }, {
        value: 'system',
        name: '系统消息'
    }, {
        value: 'private_letter',
        name: '私信'
    }],
    label: '消息类型',
    props: {
        placeholder: '选择消息类型'
    }
}, {
    key: 'target',
    Component: 'Select',
    initialValue: '',
    selectList: [{
        value: '',
        name: '全部'
    }, {
        value: 'all',
        name: '所有人'
    }, {
        value: 'assign',
        name: '指定人员'
    }],
    label: '消息接收的对象',
    props: {
        placeholder: '选择消息接收的对象'
    }
}];


export const editForm = () => {
    return [{
        key: 'title',
        Component: Input,
        label: '消息标题',
        initialValue: '',
        rules: [
            {required: true, message: '请输入消息的标题!'},

        ],
        props: {
            placeholder: '请输入消息的标题'
        }
    }, {
        key: 'details',
        Component: Input.TextArea,
        label: '消息详情',
        initialValue: '',
        rules: [
            {required: true, message: '请输入消息详情!'},
        ],
        props: {
            type: 'text',
            autosize: {minRows: 5},
            placeholder: '请输入消息详情'
        }
    }, {
        key: 'type',
        Component: 'Select',
        initialValue: 'system',
        label: '消息类型',
        selectList: [{
            value: 'system',
            name: NotiType.system
        }, {
            value: 'private_letter',
            name: NotiType.private_letter
        }],
        props: {
            placeholder: '选择此次消息类型',
        }
    }, {
        key: 'target',
        Component: 'Select',
        initialValue: 'assign',
        label: '操作的对象',
        selectList: [{
            value: 'all',
            name: NotiTarget.all
        }, {
            value: 'assign',
            name: NotiTarget.assign
        }],
        props: {
            placeholder: '选择此次操作的对象',
        }
    }]
}

